import Vue from "vue";
import App from "./App.vue";
import router from "@/router";
import store from "@/store";

//引入element ui 进行加载
import "@/element";

// 引入自定义插件
import Plugins from '@/plugins/toUpper.js'
Vue.use(Plugins,{
  name:'upper'
})

//引入图片懒加载 vue-lazyload
import VueLazyload from 'vue-lazyload'
Vue.use(VueLazyload, {
  preLoad: 1.3,
  error: require('@/assets/images/2.jpg'),
  loading:require('@/assets/images/1.gif'),
})

//统一暴露api接口
import * as API from "@/api";
Vue.prototype.$API = API;

//引入字体图标
import "@/assets/font/iconfont.css";

//三级联动--全局组件
import TypeNav from "@/components/TypeNav";
// 第一个参数是组件名,第二个参数是组件
Vue.component(TypeNav.name, TypeNav);

//加载mock
import "@/mock/mockSever.js";

//引入swiper 样式
import "swiper/css/swiper.min.css";

//全局注册 轮播图组件
import Curousel from "@/components/Curousel";
Vue.component(Curousel.name, Curousel);

//全局注册分页组件
import Pagination from "@/components/Pagination/pagination.vue";
Vue.component(Pagination.name, Pagination);

//设置总线通信
Vue.prototype.$bus = new Vue();

Vue.config.productionTip = false;

new Vue({
  render: (h) => h(App),
  // 此处是小写路由router
  router,
  //注册store
  store,
}).$mount("#app");
